package com.mhr.utils;

import org.apache.commons.beanutils.BeanUtils;
import java.util.Map;

public class MyBeanUtils {
    public static <T> T populate(Class<T> clazz, Map<String, String[]> map) {
        Object obj = null;
        try {
            obj = clazz.getDeclaredConstructor().newInstance();
            BeanUtils.populate(obj, map);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return (T) obj;
    }
}
